<?php
use Dcat\Admin\Admin;
use Dcat\Admin\Grid;
use Dcat\Admin\Form;
use Dcat\Admin\Grid\Filter;
use Dcat\Admin\Show;

/**
 * Dcat-admin - admin builder based on Laravel.
 * @author jqh <https://github.com/jqhph>
 *
 * Bootstraper for Admin.
 *
 * Here you can remove builtin form field:
 *
 * extend custom field:
 * Dcat\Admin\Form::extend('php', PHPEditor::class);
 * Dcat\Admin\Grid\Column::extend('php', PHPEditor::class);
 * Dcat\Admin\Grid\Filter::extend('php', PHPEditor::class);
 *
 * Or require js and css assets:
 * Admin::css('/packages/prettydocs/css/styles.css');
 * Admin::js('/packages/prettydocs/js/main.js');
 *
 */
Admin::baseCss(['static/css/supply'.admin_setting('style_type',2).'.css'],true);
Admin::asset()->alias('@nunito',true,'');
Admin::asset()->alias('@montserrat',true, '');


$site_url = admin_section('weburl');
$logo = '<img src ="' . $site_url . 'storage/' . admin_setting('log') . '"> &nbsp;' . admin_setting('webname');
$logo_mini = '<img src="' . $site_url . 'storage/' . admin_setting('log') . '">';

config([
    'admin_logo' => $logo,
    'admin.log-mini' => $logo_mini,
    'app.url' => admin_setting('weburl'),
    'admin.title' => admin_setting('webname'), 'admin.name' => admin_setting('webname'), 'admin. logo' => $logo,
    'admin.logo-mini' => $logo_mini,
    'admin.layout.body_class' => 'default',
    'admin.layout.sidebar_style' => admin_setting('sidebar_style'), 'admin.layout.dark_mode_switch' => true,
    'admin.layout.color' => 'blue-light',
    'admin.layout.horizontal_menu' => admin_setting('horizontal_menu'),
]);
Grid::resolving(function (Grid $grid) {
    $grid->withBorder();
    $grid->addTableClass(['table-text-center']);
    $grid->paginate(5);
    $grid->perPages([5,10, 20, 30, 40, 50]);
    $grid->enableDialogCreate();
    $grid->showColumnSelector();
    // $grid->disableEditButton(true);
    $grid->disableViewButton(true);
    $grid->setDialogFormDimensions('50%', '50%');
});